Skip to content

Conversation

@jbaublitz
Copy link
Member

@jbaublitz jbaublitz commented Sep 8, 2025

Related to stratis-storage/project#583

Summary by CodeRabbit

  • New Features

    • Support for environment variables to influence pkg-config discovery during builds: LIBBLKID_RS_PKG_CONFIG_PATH → PKG_CONFIG_PATH, LIBBLKID_RS_PKG_CONFIG_LIBDIR → PKG_CONFIG_LIBDIR, and LIBBLKID_RS_PKG_CONFIG_SYSROOT_DIR → PKG_CONFIG_SYSROOT_DIR.
  • Bug Fixes

    • Improved reliability of locating libblkid via pkg-config in nonstandard environments, custom prefixes, and cross-compilation scenarios.

@jbaublitz jbaublitz added this to the libblkid-rs-0.4.2 milestone Sep 8, 2025
@jbaublitz jbaublitz self-assigned this Sep 8, 2025
@jbaublitz jbaublitz added the enhancement New feature or request label Sep 8, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 8, 2025

Walkthrough

The build script now maps three custom environment variables to their pkg-config counterparts before invoking pkg_config::probe("blkid"), potentially influencing how libblkid is discovered. No public APIs were changed.

Changes

Cohort / File(s) Summary of changes
Build script: pkg-config env propagation
libblkid-rs-sys/build.rs
Reads LIBBLKID_RS_PKG_CONFIG_PATH, LIBBLKID_RS_PKG_CONFIG_LIBDIR, LIBBLKID_RS_PKG_CONFIG_SYSROOT_DIR and, if set, assigns them to PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR, PKG_CONFIG_SYSROOT_DIR respectively before pkg_config::probe("blkid"). Missing vars are ignored.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Cargo Build
    participant B as build.rs
    participant Env as Environment
    participant PC as pkg-config
    participant Sys as System linker

    Dev->>B: Run build script
    B->>Env: Read LIBBLKID_RS_PKG_CONFIG_* vars
    alt Vars present
        B->>Env: Set PKG_CONFIG_* accordingly
        note right of B: Mapping occurs only if present
    else Vars absent
        note right of B: No changes to environment
    end
    B->>PC: probe("blkid")
    PC->>Env: Use PKG_CONFIG_* for search
    PC-->>B: blkid metadata (include/lib paths)
    B-->>Dev: Emit cargo:rustc-link-* directives
    Dev->>Sys: Link with discovered libblkid
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudge the paths with gentle paws,
Three whispers guide pkg-config’s laws.
From burrowed env to linker’s light,
blkid is found—ears perked, just right.
A hop, a probe, a tidy trace—
Carrots secured, builds fall in place. 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66c8e36 and a2cd1b8.

📒 Files selected for processing (1)
  • libblkid-rs-sys/build.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libblkid-rs-sys/build.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-41-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
  • GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mulkieran
Copy link
Member

@coderabbitai configuration

@coderabbitai
Copy link

coderabbitai bot commented Sep 9, 2025

CodeRabbit configuration
language: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
reviews:
  profile: chill
  request_changes_workflow: false
  high_level_summary: true
  high_level_summary_placeholder: '@coderabbitai summary'
  high_level_summary_in_walkthrough: false
  auto_title_placeholder: '@coderabbitai'
  auto_title_instructions: ''
  review_status: true
  commit_status: true
  fail_commit_status: false
  collapse_walkthrough: false
  changed_files_summary: true
  sequence_diagrams: true
  estimate_code_review_effort: true
  assess_linked_issues: true
  related_issues: true
  related_prs: true
  suggested_labels: true
  auto_apply_labels: false
  suggested_reviewers: true
  auto_assign_reviewers: false
  poem: true
  labeling_instructions: []
  path_filters: []
  path_instructions: []
  abort_on_close: true
  disable_cache: false
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords: []
    labels: []
    drafts: false
    base_branches: []
    ignore_usernames: []
  finishing_touches:
    docstrings:
      enabled: true
    unit_tests:
      enabled: true
  pre_merge_checks:
    docstrings:
      mode: warning
      threshold: 80
    title:
      mode: warning
      requirements: ''
    description:
      mode: warning
    issue_assessment:
      mode: warning
    custom_checks: []
  tools:
    ast-grep:
      rule_dirs: []
      util_dirs: []
      essential_rules: true
      packages: []
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      enabled_rules: []
      disabled_rules: []
      enabled_categories: []
      disabled_categories: []
      enabled_only: false
      level: default
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: default
    phpmd:
      enabled: true
    phpcs:
      enabled: true
    golangci-lint:
      enabled: true
    yamllint:
      enabled: true
    gitleaks:
      enabled: true
    checkov:
      enabled: true
    detekt:
      enabled: true
    eslint:
      enabled: true
    flake8:
      enabled: true
    rubocop:
      enabled: true
    buf:
      enabled: true
    regal:
      enabled: true
    actionlint:
      enabled: true
    pmd:
      enabled: true
    cppcheck:
      enabled: true
    semgrep:
      enabled: true
    circleci:
      enabled: true
    clippy:
      enabled: true
    sqlfluff:
      enabled: true
    prismaLint:
      enabled: true
    pylint:
      enabled: true
    oxc:
      enabled: true
    shopifyThemeCheck:
      enabled: true
    luacheck:
      enabled: true
    brakeman:
      enabled: true
    dotenvLint:
      enabled: true
    htmlhint:
      enabled: true
    checkmake:
      enabled: true
    osvScanner:
      enabled: true
chat:
  art: true
  auto_reply: true
  integrations:
    jira:
      usage: auto
    linear:
      usage: auto
knowledge_base:
  opt_out: false
  web_search:
    enabled: true
  code_guidelines:
    enabled: true
    filePatterns: []
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    usage: auto
    project_keys: []
  linear:
    usage: auto
    team_keys: []
  pull_requests:
    scope: auto
  mcp:
    usage: auto
    disabled_servers: []
code_generation:
  docstrings:
    language: en-US
    path_instructions: []
  unit_tests:
    path_instructions: []

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/stratis-storage-libblkid-rs-220
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants